<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link rel="stylesheet" href="../static/css/css.css">
<script src="../static/js/jquery-1.8.3.js"></script>
<script>
    function saveHelpRecord() {
        $.ajax({
            type:"get",
            url:"/saveHelpRecord",
            data:{"gsmBargainRecordId":[[${bre.gsmBargainRecordId}]]},
            dataType:"json",
            success:function (res) {
                if (res.code === 0) {
                    alert("砍价成功")
                }
                if (res.msg === "不能给自己砍价") {
                    alert("不能给自己砍价")
                }
                if (res.msg === "只能帮砍该用户一次") {
                    alert("只能帮砍该用户一次")
                }

            }
        })
    }
</script>
<body>

<ul>
    <li>
        <a th:if="${session.user != null}">欢迎, [[${session.user.usmName}]]</a>
        <a th:if="${session.user == null}" th:href="'http://auth.snow-mall.com?url=http://bargain.snow-mall.com/toSaveHelpRecord?gsmBargainRecordId='${bre.psmBargainRecordId}">你好，请登录</a>
    </li>
    <li>
        <a th:if="${session.user == null}" href="http://auth.snow-mall.com/register.html" class="li_2">免费注册</a>
    </li>
    <li>
        <a th:if="${session.user != null}" href="http://auth.snow-mall.com/loguot.html" class="li_2">立即退出</a>
    </li>
</ul>
活动名称 <input type="text" disabled  th:value="${bre.gsmBargainName}"> <br>
商品名称 <input type="text" disabled  th:value="${bre.psmName}"> <br>
商品展示 <input type="text" disabled  th:value="${bre.psmImg}"> <br>
商品原价 <input type="text" disabled  th:value="${bre.psmPrice}"> <br>
当前价格 <input type="text" disabled  th:value="${bre.gsmBargainPriceNow}"> <br>
当前状态 <input type="text" disabled  th:value="${bre.gsmBargainRecordStatus}"> <br>

<input type="button" value="帮他砍价" onclick="saveHelpRecord()" >
</body>
</html>
